package com.reremouse.rerebbs.dao.impl;

import com.reremouse.model.PartnerType;
import com.reremouse.rerebbs.dao.IPartnerTypeDAO;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.io.Serializable;
import java.util.List;

public class PartnerTypeDAO
        implements IPartnerTypeDAO, Serializable {
    @PersistenceContext
    private EntityManager entityManager;

    public EntityManager getEntityManager() {
        return this.entityManager;
    }

    public void setEntityManager(EntityManager entityManager) {
        this.entityManager = entityManager;
    }

    public void addPartnerType(PartnerType paramPartnerType) {
        this.entityManager.persist(paramPartnerType);
    }

    public void deletePartnerType(long paramString) {
        PartnerType yp = (PartnerType) this.entityManager.find(PartnerType.class, Long.valueOf(paramString));
        this.entityManager.remove(yp);
    }

    public List<PartnerType> findAllPartnerType() {
        String q = "select yis from PartnerType yis order by yis.ord";
        List<PartnerType> ps = this.entityManager.createQuery(q).getResultList();
        return ps;
    }

    public PartnerType findPartnerType(long paramString) {
        PartnerType p = (PartnerType) this.entityManager.find(PartnerType.class, Long.valueOf(paramString));
        return p;
    }

    public void updatePartnerType(PartnerType paramPartnerType) {
        this.entityManager.merge(paramPartnerType);
    }
}



/* Location:           F:\jsp源码\蝙蝠论坛系统\rerebbs\WEB-INF\classes\

 * Qualified Name:     com.reremouse.rerebbs.dao.impl.PartnerTypeDAO

 * JD-Core Version:    0.7.0.1

 */